#ifndef __MYSQL_UTILS_HH__
#define __MYSQL_UTILS_HH__

#include <math.h>
#include <mysql++.h>

// this struct is used by mysql++ template mysqlpp::Null to create
// represention of DB null value
struct NullIsNan {
  static double null_is() { 
    return sqrt(-1.0); 
    //return 0.0;
  }
  static std::ostream& null_ostr(std::ostream& o) {
    o << sqrt(-1.0);
    return o;
  }
};

struct MySqlUtils {
  static mysqlpp::StoreQueryResult q_single_row(mysqlpp::Connection* conn, 
						const char* q);
  static mysqlpp::StoreQueryResult q(mysqlpp::Connection* conn,
				     const char* q);
};

#endif
